package com.cn.wanxi.util;

import java.io.*;

public class ReadNote {

    /**
     * 读取记事本内容，并返回字符串
     *
     * @param path
     * @return
     */
    public static String read(String path) {
        File file = new File(path);
        StringBuilder stringBuilder = new StringBuilder();
//        InputStream inputStream=
        try {
            Reader reader = new FileReader(file);
            int a = 0;
            while ((a = reader.read()) != -1) {
                stringBuilder.append((char) a);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return stringBuilder.toString();
    }

}
